package com.lanchetech.merchant.controller;

import com.lanchetech.bean.response.ResultData;
import com.lanchetech.bean.vo.MerchantHomeStatisticsVO;
import com.lanchetech.merchant.service.WebService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "网站管理接口", tags = "网站管理接口")
@RequestMapping("/api/web")
@RestController
public class WebController {
    @Autowired
    WebService webService;

    @ApiOperation("获取首页统计")
    @PreAuthorize("hasAuthority('home.index')")
    @GetMapping("/getHomeStatistics")
    public ResultData<MerchantHomeStatisticsVO> getHomeStatistics() {
        return webService.getHomeStatistics();
    }

}
